package com.business.system.service.impl;

import java.util.List;
import java.util.Map;

import net.sf.rose.jdbc.service.Service;

import com.business.system.service.OrderService;
import com.business.system.util.DBTools;

/**
 * @author: xudy
 * @date: 2018/04/20 13:27
 * @description:
 */
@org.springframework.stereotype.Service
public class OrderServiceImpl implements OrderService {
    @Override
    public List<Map<String,Object>> getOrderGoodsById(Service service, String orderId) {
        StringBuilder sql = new StringBuilder();
        //获取每个订单的商品信息
        sql.append("select t1.counts,t2.* from order_goods t1 left join goods t2 on t1.goods_id = t2.id");
        sql.append(" where t1.orders_id=?");
        List<Map<String,Object>> goods = DBTools.getDataList(service,sql.toString(),orderId);
        return goods;
    }
}